var about = {
    modify:function(){
    	var imagePath = $('#aboutUsFilePath').val();
    	var aboutUsContent = editor.getSource();;

        if(!imagePath){
            $.msgBox.alert({
                title:'Tips',
                msg : 'Preview image is null,please select a image file!',
                icon:'warning',
                width:450
            });
            return false;
        }
    	if(!aboutUsContent){
            $.msgBox.alert({
                title:'Tips',
                msg:'About us content is null,please input a value!',
                icon:'warning',
                width:450
            });
            return false;
    	}
    	$.ajax({
			type : "POST",
			url : "../about/modify.json",
			cache : false,
			dataType : "json",
			data : {
				"imagePath" : imagePath,
				"contentInfo" : aboutUsContent
			},
			success : function(data) {
				if (data.result == 'success') {
					$.msgBox.alert({
						title : 'Success',
						msg : 'Modify Success!',
						icon : 'warning',
						width : 250
					});
				} else {
					$.msgBox.alert({
						title : 'Tips',
						msg : 'System error,please try again later!',
						icon : 'warning',
						width : 350
					});
				}
			}
		});
    },
    detail:function(){
    	$.ajax({
            type: "GET",
            url: "../about/detail.json",
            cache:false,
            dataType: "json",
            success: function(data){
                if(data.result == 'success'){
                    var obj = data.aboutUs;
                    
                    $('#aboutUsFilePath').val(obj.imagePath);
                    $('#aboutUsImage').attr("src",config.baseURL+obj.imagePath);

                    editor.setSource(obj.contentInfo);
                }else{
                    $.msgBox.alert({
                        title:'Tips',
                        msg:'System error!Please try again later!',
                        icon:'warning',
                        width:350
                    });
                }
            }
        });
    }
};